package com.zhupf.springcloud.service.payment;

import com.zhupf.springcloud.entity.CommonResult;
import com.zhupf.springcloud.entity.Payment;
import com.zhupf.springcloud.service.payment.fallback.PaymentServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "cloud-payment-service",fallback = PaymentServiceFallback.class)
public interface PaymentService {

    @GetMapping(value = "/payment/info/{id}")
    CommonResult<Payment> info(@PathVariable("id") Long id);

    @PostMapping(value = "/payment/create")
    CommonResult create(@RequestBody Payment payment);

    @GetMapping("/payment/zipkin")
    String zipkin();

    @GetMapping("/payment/timeout")
    String timeOut();
}
